<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    /*
    小明家里有三个人，爸爸和妈妈，小明是男的，今年18岁，兴趣爱好是打篮球和读书，
    爸爸是软件程序员，
    妈妈是UI设计师，
    小明家在深圳南山有一套100平方的房子，户型是三房一厅，
    今年小明家刚买了一辆特斯拉Model3
    */
    ///////////////new Object////////////////////
    let xiaoming = new Object();
    xiaoming.xb = "男";
    xiaoming.aihao = "打篮球和看书";
    xiaoming.nl = "18";
    console.log(xiaoming);

    let baba = new Object();
    baba.gz = "软件程序员";
    console.log(baba);

    let mama = new Object();
    mama.gz = "UI设计师";
    console.log(mama);

    let fz = new Object();
    fz.dx = "100平";
    fz.hx = "三房一厅";
    console.log(fz);

    let c = new Object();
    c.pz = "特斯拉";
    c.xh = "Model3";
    console.log(c)


    //////////////////函数//////////////////

    function sb(sex, age, hobby) {
        this.sex = sex;
        this.age = age;
        this.hobby = hobby;
    }
    let xiaomin = new sb("男", 18, "打篮球和读书");
    console.log(xiaomin);



    function sd(gz) {
        this.gz = gz;
    }
    let bb = new sd("软件程序员");
    console.log(bb);



    function mma1(gz) {
        this.gz = gz;
    }
    let mama1 = new mma1("UI设计师");
    console.log(mama);



    function che(pz, xh) {
        this.pz = pz;
        this.xh = xh;
    }
    let chezi = new che("特斯拉", "Model3");
    console.log(chezi);


    function f(dax, hux) {
        this.dax = dax;
        this.hux = hux;
    }
    let fan = new f("100平", "三房一厅");
    console.log(fan);



    ///////////////////字面量/////////////////


    let ximing = {
        xb: "男",
        aihao: "打篮球和看书",
        nl: "18",
    };
    console.log(ximing);

    let bab = {
        gz: "软件程序员"
    };
    console.log(bab);

    let mama2 = {
        gz: "UI设计师"
    };
    console.log(mama2);

    let fzii = {
        dx: "100平",
        hux: "三房一厅",
    };
    console.log(fzii);

    let czi = {
        pz: "特斯拉",
        xh: "Model3",
    };
    console.log(czi);

</script>

</html>